survey$income <- survey$F6
# age
survey$age <- survey$F4
# race
survey$race <- survey$F9
# politics (party)
survey$party <- survey$P5A
# politics (ideology)
survey$ideology <- NA
# gender
survey$gender <- survey$F1
# religion
survey$religion <- survey$F7
# subset
survey_7487 <- survey[,c("pid", "study", "year", "urban", "region", "hh",
"inequality", "inequality.variable", "union.self", "union.other",
"employed", "occupation", "hhsize", "educ", "income",
"age", "race", "party", "ideology", "gender", "religion")]
summary(survey_7487)
summary(survey$F1)
survey$hh <- factor(dplyr::recode(survey$F1,
`Male head` = "Yes",
`Female head (no male head)` = "Yes",
`Wife` = "No",
`Son` = "No",
`Daughter` = "No",
`Other (specify)` = "No"))
summary(survey$hh)
survey$gender <- survey$F10
summary(survey$gender)
setwd("~/Dropbox/Perception_Inequality_wHannah/Survey Files/Harris 1974 Job Satisfaction and Union Survey, study nos. 7487 and 7488")
library(dplyr)
library(tidyr)
library(car)
library(readstata13)
survey <- read.dta13("harris_s7487_spss.dta")
# pid
survey$pid <- c(1:nrow(survey))
# study
survey$study <- 7487
# study year (year)
survey$year <- 1974
# geographic data (urban)
survey$urban <- car::recode(survey$S13, "'Central city' = 'Urban'; 'Town' = 'Rural';
'Suburb' = 'Suburban'")
# geographic data (region)
survey$region <- survey$S11
levels(survey$region) <- list(East=c("East_(1)", "East_(2)"), Midwest=c("Midwest_(5)", "Midwest_(6)"),
South=c("South_(3)", "South_(4)"),
West=c("West_(7)", "West_(8)"))
class(survey$region)
# respondent head of household (hh)
summary(survey$F1)
survey$hh <- factor(dplyr::recode(survey$F1,
`Male head` = "Yes",
`Female head (no male head)` = "Yes",
`Wife` = "No",
`Son` = "No",
`Daughter` = "No",
`Other (specify)` = "No"))
summary(survey$hh)
# increasing inequality (inequality)
survey$inequality <- car::recode(survey$P10_B, "'Don t Feel' = 'Don t feel'; 'Not Sure' = 'Not sure'")
# inequality variable (inequality.variable)
survey$inequality.variable <- 1
# union (union.self)
survey$union.self <- survey$Q5A_1 # already harmonized
# union (union.other)
survey$union.other <- survey$Q5A_2 # already harmonized
# employment (employed)
survey$employed <- survey$F2A
# occupation
survey$occupation <- survey$F2B
# household size (hhsize)
survey$hhsize <- NA
# education (educ)
survey$educ <- survey$F5
survey$educ <- as.numeric(survey$educ)
survey$educ <- car::recode(survey$educ, "c(1, 2, 3, 4) = 'Less than high school';
5 = 'High school graduate';
c(6, 7) = 'Some college';
8 = 'College graduate';
9 = 'Post graduate';
else = 'NA'")
survey$educ <- as.factor(survey$educ)
survey$educ <- factor(survey$educ, levels = c("Less than high school", "High school graduate", "Some college", "College graduate", "Post graduate"),
labels = c("Less than high school", "High school graduate", "Some college", "College graduate", "Post graduate"),
ordered = TRUE)
# household income (income)
survey$income <- survey$F6
# age
survey$age <- survey$F4
# race
survey$race <- survey$F9
# politics (party)
survey$party <- survey$P5A
# politics (ideology)
survey$ideology <- NA
# gender
survey$gender <- survey$F10
summary(survey$gender)
# religion
survey$religion <- survey$F7
# subset
survey_7487 <- survey[,c("pid", "study", "year", "urban", "region", "hh",
"inequality", "inequality.variable", "union.self", "union.other",
"employed", "occupation", "hhsize", "educ", "income",
"age", "race", "party", "ideology", "gender", "religion")]
summary(survey_7487)
saveRDS(survey_7487, file = "survey_7487.rds")
setwd("~/Dropbox/Perception_Inequality_wHannah/Survey Files/Harris 1974 President Ford's Pardon of President Nixon Survey, study no. 2430")
setwd("~/Dropbox/Perception_Inequality_wHannah/Survey Files/Harris 1974 President Ford's Pardon of President Nixon Survey, study no. 2430")
library(dplyr)
library(tidyr)
library(car)
library(readstata13)
survey <- read.dta13("harris_s2430_spss.dta")
# pid
survey$pid <- c(1:nrow(survey))
# study
survey$study <-2430
# study year (year)
survey$year <- 1974
# geographic data (urban)
survey$urban <- car::recode(survey$S13, "'Central city' = 'Urban'; 'Town' = 'Rural';
'Suburb' = 'Suburban'; 'Rural' = 'Rural'")
# geographic data (region)
survey$region <- survey$S11
levels(survey$region) <- list(East=c("East_(1)", "East_(2)"), Midwest=c("Midwest_(5)", "Midwest_(6)"),
South=c("South_(3)", "South_(4)"),
West=c("West_(7)", "West_(8)"))
class(survey$region)
# respondent head of household (hh)
survey$hh <- NA
# increasing inequality (inequality)
survey$inequality <- car::recode(survey$Q7_B, "'don t feel' = 'Don t feel'; 'not sure' = 'Not sure'")
# inequality variable (inequality.variable)
survey$inequality.variable <- 1
# union (union.self)
survey$union.self <- survey$F4_1 # already harmonized
# union (union.other)
survey$union.other <- survey$F4_2
# employment (employed)
survey$employed <- survey$F1A
# occupation
survey$occupation <- survey$F1B
# household size (hhsize)
survey$hhsize <- NA
# education (educ)
survey$educ <- as.numeric(survey$F3)
survey$educ <- car::recode(survey$educ, "c(1, 2, 3, 4) = 'Less than high school';
5 = 'High school graduate';
c(6, 7) = 'Some college';
8 = 'College graduate';
9 = 'Post graduate';
else = 'NA'")
survey$educ <- factor(survey$educ, levels = c("Less than high school", "High school graduate", "Some college", "College graduate", "Post graduate"),
labels = c("Less than high school", "High school graduate", "Some college", "College graduate", "Post graduate"),
ordered = TRUE)
# household income (income)
survey$income <- survey$F5
# age
survey$age <- survey$F2
# race
survey$race <- survey$F7
# politics (party)
survey$party <- survey$Q4A
# politics (ideology)
survey$ideology <- NA
# gender
survey$gender <- survey$F8
# religion
survey$religion <- survey$F6
# subset
survey_2430 <- survey[,c("pid", "study", "year", "urban", "region", "hh",
"inequality", "inequality.variable", "union.self", "union.other",
"employed", "occupation", "hhsize", "educ", "income",
"age", "race", "party", "ideology", "gender", "religion")]
summary(survey_2430)
setwd("~/Dropbox/Perception_Inequality_wHannah/Survey Files/Harris 1974 Watergate Survey, study no. 2434")
## packages
require("SASxport")
require("dplyr")
require("readstata13")
## download data
survey <- read.dta13("harris_s2434_spss.dta")
## pid
survey$pid <- c(1:nrow(survey))
class(survey$pid)
## study number
survey$study <- 2434
class(survey$study)
## year
survey$year <- 1974
class(survey$year)
## geographpic data
survey$urban <- survey$S13
survey$urban <- recode(survey$urban, `Central City` = "Urban",
`Suburb` = "Suburban",
`Town` = "Rural")
summary(survey$urban)
## region
survey$region <- survey$S11
survey$region <- recode(survey$region, `East_(1)` = "East",
`East_(2)` = "East", `South_(3)` = "South",
`South_(4)` = "South", `Midwest_(5)` = "Midwest",
`Midwest_(6)` = "Midwest", `West_(7)` = "West",
`West_(8)` = "West")
summary(survey$region)
## respondent name
summary(survey$F1)
survey$hh <- recode(survey$F1, `Male head` = "Yes", `Female head (no male head)` = "Yes",
`Wife` = "No", `Son` = "No", `Daughter` = "No", `Other (specify)` = "No")
summary(survey$hh)
## inequality increasing
summary(survey$Q7_B)
survey$inequality <- survey$Q7_B
survey$inequality <- recode(survey$inequality,
`Don t Feel` = "Don't Feel")
summary(survey$inequality)
class(survey$inequality)
is.ordered(survey$inequality)
## inequality variable version
survey$inequality.variable <- 1
class(survey$inequality.variable)
## union
survey$union.self <- survey$F6_1
survey$union.other <- survey$F6_2
summary(survey$union.self)
## Are you employed? what kind of employment?
summary(survey$F2A)
survey$employed <- survey$F2A
summary(survey$employed)
## Occupation
summary(survey$F2B)
survey$occupation <- survey$F2B
summary(survey$occupation)
## household size
survey$hhsize <- NA
## Education
summary(survey$F5)
survey$educ <- survey$F5
survey$educ <- recode(survey$educ,
`C No formal schooling (0 years)` = "Less than high school",
`D Frst thrgh svnth grd (1-7 yrs f schl c` = "Less than high school",
`E 8th grd (8 yrs f schl cmpltd)` = "Less than high school",
`F Sm hgh schl (9-11 yrs f schl cmpltd)` = "Less than high school",
`G Hgh schl grdt (12 yrs f schl cmpltd)` = "High school graduate",
`H Sm cllg (1-3 yrs f cllg cmpltd)` = "Some college",
`I Tw yr cllg grdt (cmpltd 2 yrs cmmnty c` = "Some college",
`J Fr yr cllg grdt (cmpltd 4 yrs f cllg)` = "College graduate",
`K Post graduate (4 year college graduate` = "Post graduate")
class(survey$educ)
summary(survey$educ)
survey$educ <- as.ordered(survey$educ)
## Income
summary(survey$F7)
survey$income <- survey$F7
summary(survey$income)
class(survey$income)
## Age
summary(survey$F4)
survey$age <- survey$F4
summary(survey$age)
## race
summary(survey$F10)
survey$race <- survey$F10
summary(survey$race)
## politics
survey$party <- survey$Q4A
summary(survey$party)
class(survey$party)
## ideology
survey$ideology <- NA
summary(survey$ideology)
## gender
summary(survey$F11)
survey$gender <- survey$F11
table(survey$gender)
## religion
survey$religion <- survey$F8
summary(survey$religion)
### put together data set
survey_2434 <- survey[,c("pid", "study", "year", "urban", "region", "hh",
"inequality", "inequality.variable", "union.self", "union.other",
"employed", "occupation", "hhsize", "educ", "income",
"age", "race", "party", "ideology", "gender", "religion")]
setwd("~/Dropbox/Perception_Inequality_wHannah/Survey Files/Harris 1974 Watergate Survey, study no. 2434")
## packages
require("SASxport")
require("dplyr")
require("readstata13")
## download data
survey <- read.dta13("harris_s2434_spss.dta")
## pid
survey$pid <- c(1:nrow(survey))
class(survey$pid)
## study number
survey$study <- 2434
class(survey$study)
## year
survey$year <- 1974
class(survey$year)
## geographpic data
survey$urban <- survey$S13
survey$urban <- recode(survey$urban, `Central City` = "Urban",
`Suburb` = "Suburban",
`Town` = "Rural")
summary(survey$urban)
## region
survey$region <- survey$S11
survey$region <- recode(survey$region, `East_(1)` = "East",
`East_(2)` = "East", `South_(3)` = "South",
`South_(4)` = "South", `Midwest_(5)` = "Midwest",
`Midwest_(6)` = "Midwest", `West_(7)` = "West",
`West_(8)` = "West")
summary(survey$region)
## respondent name
summary(survey$F1)
survey$hh <- recode(survey$F1, `Male head` = "Yes", `Female head (no male head)` = "Yes",
`Wife` = "No", `Son` = "No", `Daughter` = "No", `Other (specify)` = "No")
summary(survey$hh)
## inequality increasing
summary(survey$Q7_B)
survey$inequality <- survey$Q7_B
survey$inequality <- recode(survey$inequality,
`Don t Feel` = "Don't Feel")
summary(survey$inequality)
class(survey$inequality)
is.ordered(survey$inequality)
## inequality variable version
survey$inequality.variable <- 1
class(survey$inequality.variable)
## union
survey$union.self <- as.character(survey$F6_1)
survey$union.self[survey$F6_4 == "Yes"] <- "Not Sure"
survey$union.self <- factor(survey$union.self)
survey$union.other <- as.character(survey$F6_2)
survey$union.other[survey$F6_4 == "Yes"] <- "Not Sure"
survey$union.other <- factor(survey$union.other)
## Are you employed? what kind of employment?
summary(survey$F2A)
survey$employed <- survey$F2A
summary(survey$employed)
## Occupation
summary(survey$F2B)
survey$occupation <- survey$F2B
summary(survey$occupation)
## household size
survey$hhsize <- NA
## Education
summary(survey$F5)
survey$educ <- survey$F5
survey$educ <- recode(survey$educ,
`C No formal schooling (0 years)` = "Less than high school",
`D Frst thrgh svnth grd (1-7 yrs f schl c` = "Less than high school",
`E 8th grd (8 yrs f schl cmpltd)` = "Less than high school",
`F Sm hgh schl (9-11 yrs f schl cmpltd)` = "Less than high school",
`G Hgh schl grdt (12 yrs f schl cmpltd)` = "High school graduate",
`H Sm cllg (1-3 yrs f cllg cmpltd)` = "Some college",
`I Tw yr cllg grdt (cmpltd 2 yrs cmmnty c` = "Some college",
`J Fr yr cllg grdt (cmpltd 4 yrs f cllg)` = "College graduate",
`K Post graduate (4 year college graduate` = "Post graduate")
class(survey$educ)
summary(survey$educ)
survey$educ <- as.ordered(survey$educ)
## Income
summary(survey$F7)
survey$income <- survey$F7
summary(survey$income)
class(survey$income)
## Age
summary(survey$F4)
survey$age <- survey$F4
summary(survey$age)
## race
summary(survey$F10)
survey$race <- survey$F10
summary(survey$race)
## politics
survey$party <- survey$Q4A
summary(survey$party)
class(survey$party)
## ideology
survey$ideology <- NA
summary(survey$ideology)
## gender
summary(survey$F11)
survey$gender <- survey$F11
table(survey$gender)
## religion
survey$religion <- survey$F8
summary(survey$religion)
### put together data set
survey_2434 <- survey[,c("pid", "study", "year", "urban", "region", "hh",
"inequality", "inequality.variable", "union.self", "union.other",
"employed", "occupation", "hhsize", "educ", "income",
"age", "race", "party", "ideology", "gender", "religion")]
summary(survey_2434)
saveRDS(survey_2434, file = "survey_2434.rds")
setwd("~/Dropbox/Perception_Inequality_wHannah/Survey Files/Harris 1974 Watergate Survey, study no. 2434")
## packages
require("SASxport")
require("dplyr")
require("readstata13")
## download data
survey <- read.dta13("harris_s2434_spss.dta")
## pid
survey$pid <- c(1:nrow(survey))
class(survey$pid)
## study number
survey$study <- 2434
class(survey$study)
## year
survey$year <- 1974
class(survey$year)
## geographpic data
survey$urban <- survey$S13
survey$urban <- recode(survey$urban, `Central City` = "Urban",
`Suburb` = "Suburban",
`Town` = "Rural")
summary(survey$urban)
## region
survey$region <- survey$S11
survey$region <- recode(survey$region, `East_(1)` = "East",
`East_(2)` = "East", `South_(3)` = "South",
`South_(4)` = "South", `Midwest_(5)` = "Midwest",
`Midwest_(6)` = "Midwest", `West_(7)` = "West",
`West_(8)` = "West")
summary(survey$region)
## respondent name
summary(survey$F1)
survey$hh <- recode(survey$F1, `Male head` = "Yes", `Female head (no male head)` = "Yes",
`Wife` = "No", `Son` = "No", `Daughter` = "No", `Other (specify)` = "No")
summary(survey$hh)
## inequality increasing
summary(survey$Q7_B)
survey$inequality <- survey$Q7_B
survey$inequality <- recode(survey$inequality,
`Don t Feel` = "Don't Feel")
summary(survey$inequality)
class(survey$inequality)
is.ordered(survey$inequality)
## inequality variable version
survey$inequality.variable <- 1
class(survey$inequality.variable)
## union
survey$union.self <- as.character(survey$F6_1)
survey$union.self[survey$F6_4 == "Yes"] <- "Not Sure"
survey$union.self <- factor(survey$union.self)
survey$union.other <- as.character(survey$F6_2)
survey$union.other[survey$F6_4 == "Yes"] <- "Not Sure"
survey$union.other <- factor(survey$union.other)
## Are you employed? what kind of employment?
summary(survey$F2A)
survey$employed <- survey$F2A
summary(survey$employed)
## Occupation
summary(survey$F2B)
survey$occupation <- survey$F2B
summary(survey$occupation)
## household size
survey$hhsize <- NA
## Education
summary(survey$F5)
survey$educ <- survey$F5
survey$educ <- recode(survey$educ,
`C No formal schooling (0 years)` = "Less than high school",
`D Frst thrgh svnth grd (1-7 yrs f schl c` = "Less than high school",
`E 8th grd (8 yrs f schl cmpltd)` = "Less than high school",
`F Sm hgh schl (9-11 yrs f schl cmpltd)` = "Less than high school",
`G Hgh schl grdt (12 yrs f schl cmpltd)` = "High school graduate",
`H Sm cllg (1-3 yrs f cllg cmpltd)` = "Some college",
`I Tw yr cllg grdt (cmpltd 2 yrs cmmnty c` = "Some college",
`J Fr yr cllg grdt (cmpltd 4 yrs f cllg)` = "College graduate",
`K Post graduate (4 year college graduate` = "Post graduate")
class(survey$educ)
summary(survey$educ)
survey$educ <- as.ordered(survey$educ)
## Income
summary(survey$F7)
survey$income <- survey$F7
summary(survey$income)
class(survey$income)
## Age
summary(survey$F4)
survey$age <- survey$F4
summary(survey$age)
## race
summary(survey$F10)
survey$race <- survey$F10
summary(survey$race)
## politics
survey$party <- survey$Q4A
summary(survey$party)
class(survey$party)
## ideology
survey$ideology <- NA
summary(survey$ideology)
## gender
summary(survey$F11)
survey$gender <- survey$F11
table(survey$gender)
## religion
survey$religion <- survey$F8
summary(survey$religion)
### put together data set
survey_2434 <- survey[,c("pid", "study", "year", "urban", "region", "hh",
"inequality", "inequality.variable", "union.self", "union.other",
"employed", "occupation", "hhsize", "educ", "income",
"age", "race", "party", "ideology", "gender", "religion")]
summary(survey_2434)
